local skill = fk.CreateSkill{
  name = "tea__shanmeng",
}
---@type TrigSkelSpec<TrigFunc>
local shanmeng = {
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    if player:usedSkillTimes(skill.name, Player.HistoryTurn) == 0 and player:hasSkill(skill.name) and target.chained then
      return table.find(player.room:getOtherPlayers(target), function(p)
        return p.chained
      end)
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local targets = room:getOtherPlayers(target)
    for _, p in ipairs(targets) do
      if p.chained and not p:isNude() and not p.dead then
        local cid = room:askToCards(p, {
          min_num = 1,
          max_num = 999,
          include_equip = true,
          skill_name = skill.name,
          cancelable = false,
          prompt = "#tea__shanmeng-give:" .. target.id
        })
        if #cid > 0 then
          room:obtainCard(target, cid, false, fk.ReasonGive)
        end
      end
    end
  end,
}
skill:addEffect(fk.TargetConfirming, shanmeng)
return skill